﻿@using Blogifier.Shared
@using Blogifier.Shared.Resources
@using Microsoft.Extensions.Localization
@inject IStringLocalizer<Resource> _localizer
@{
    var request = Url.ActionContext.HttpContext.Request;
    var absoluteUrl = $"{request.Scheme}://{request.Host.ToUriComponent()}{request.PathBase.ToUriComponent()}";

    var siteTitle = Model.Blog.Title;
    var siteDesc = Model.Blog.Description;

    @* TODO: Customfield *@
    var siteMark = "titleDesc";
    var siteLogo = "/themes/standard/img/logo-black.png";
}

<header class="header">
    <div class="container d-md-flex align-items-md-center">
        <section class="header-sign py-4 py-md-0 text-center text-md-start me-md-auto">
            @if (siteMark == "logo")
            {
                <a class="header-logo" href="@absoluteUrl">
                    <img class="header-logo-img" src="@siteLogo" alt="@siteTitle @_localizer["logo"]">
                </a>
            }
            else if (siteMark == "title")
            {
                <a class="header-title" href="@absoluteUrl">@siteTitle</a>
            }
            else if (siteMark == "titleDesc")
            {
                <a class="header-title" href="@absoluteUrl">@siteTitle</a>
                <p class="header-desc">@siteDesc</p>
            }
        </section>

        <partial name="../components/nav.cshtml" />
    </div>
</header>
